package com.uzai.console.enums;

import com.alibaba.excel.util.StringUtils;

/**
 * 支付宝个人批量转账记录明细状态
 * @Auther: liuqi
 * @Date: 2021/8/19 11:22
 * @Description:
 */
public enum AlipayMchBatchDetailStatusEnum {

    INIT("INIT","初始"),
    APPLIED("APPLIED","已下单"),
    DEALED("DEALED","处理中"),
    SUCCESS("SUCCESS","成功"),
    DISUSE("DISUSE","已废除"),
    FAIL("FAIL","处理失败"),
    UNKNOWN("UNKNOWN","未知状态"),
    ;

    private String key;
    private String desc;

    AlipayMchBatchDetailStatusEnum(String key, String desc) {
        this.key = key;
        this.desc = desc;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static AlipayMchBatchDetailStatusEnum getByKey(String key) {
        if (StringUtils.isBlank(key)) {
            return null;
        }
        for (AlipayMchBatchDetailStatusEnum type: AlipayMchBatchDetailStatusEnum.values()) {
            if (type.getKey().equals(key)) {
                return type;
            }
        }
        return null;
    }
}
